home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / view9206.zip / INSIDE.TXT < prev    next >
Text File  |  1992-05-07  |  7KB  |  120 lines

  1. The Inside View
  2.  
  3. The purpose of this document is to provide information on 'How to compile a working
  4. View system'.  Details are given on 'where the files are kept', 'what is required to make
  5. them work', and 'how to make View compatible mail utilities'.
  6.  
  7.  
  8. Files:
  9.  
  10. In order to compile View, you must be using Turbo Pascal version 6.0 from Borland. 
  11. Other versions may work, but I only guarantee the latest version.  You will also need
  12. some extra UNITs.  Units are pascal libraries giving you extra commands.  The units
  13. required are:  novell.pas, textlink.pas and the Turbo Technojock Library.  The TTT5
  14. library can be found on BIZ2 in \hamster\pascal\tttpas.arc.  The source for View can be
  15. found on BIZ2 in \view\source\*.*.  
  16.  
  17. If you are starting from scratch, install Turbo Pascal 6.0 onto your hard drive.  UNarc
  18. TTTPAS.ARC into a subdirectory.  Follow the TTT doc file on how to compile the units. 
  19. Copy novell.pas, and textlink.pas into your source directory.  Compile them also.  Once
  20. compiled, they can be used by any program.  Each program is compiled separately.  The
  21. only kink in the system is VIEW.PAS.  The source  for view contains code for both the
  22. network and ham versions.  Near the top of VIEW.PAS you will see a {$DEFINE
  23. NOVELL}.  If it is there, then a network compatible version is generated.  If you remove
  24. it, or change it in any way, then a HAM (stand-alone) copy is generated.  All other
  25. utilities only have 1 version and can be used by either version of View.
  26. File Formats:
  27.  
  28.  
  29. View does not deliver the mail.  View creates messages to be sent, and reads messages
  30. already placed in your mailbox.  The POSTMAN delivers the mail and notifies users of
  31. new mail.  If you want to write mail utilities, then you must know how to create mailer
  32. files.  Mailer files are used to move a message from sender to receiver.  Postman does not
  33. know or care about which application generated the files.  The rest of this document will
  34. describe what is required from a program to generate proper mailer files.
  35.  
  36.  
  37. Mail format:  View creates Internet compatible mail files.  That means the header
  38. contains the neccessary info in the proper format to be excepted by any Internet mail
  39. system.  Information on 'mail header formats' is available from most Network
  40. Information Centres including CCS at the UWO Natural Sciences Building.
  41.  
  42.  
  43. Location:  View uses the novell mail directories for the placement of both incoming and
  44. outgoing messages.  For example:  MBRAMWEL has SYS:MAIL/F003F
  45.  
  46.  
  47. Sequence numbers:  Every time a message a generated by View, a complete set of files is
  48. created for each recipient.  For example, if you send a message to both Mark and Steve,
  49. two completely separate sets of files are created, 1 for Mark and 1 for Steve, even though
  50. the content is the same.  This is because it is possible for one message to be delivered ok,
  51. whereas the second message might get 'bounced' back to the sender.  
  52.  
  53. View uses 'sequence' numbers to maintain a sense of order with the files.  Each 'set' has
  54. an unique sequence number.  The 'last number used' is stored in SEQUENCE.SEQ.  If
  55. this file does not exist, it is safe to assume that we can use the number 1 (unless it is
  56. locked).  Both Postman and View locks files before openning them, and it unlocks the
  57. same files when done.  To make things work, you should check for these file locks.  To
  58. lock SEQUENCE.SEQ, create SEQUENCE.LCK in the same directory.  It does not
  59. matter if there is any data in the file.  If SEQUENCE.LCK already exists, then wait until
  60. it disappears before touching the sequence file.  In my programs, I usually stop waiting
  61. after 10 seconds.  If the program takes more than 10 seconds, then the machine it was
  62. running on has probally hung.  After you have successfully created SEQUENCE.LCK;
  63. open SEQUENCE.SEQ; read the number stored it in; add one to the number; rewrite
  64. SEQUENCE.SEQ with the new number; erase SEQUENCE.LCK.  We now have our
  65. own unique sequence number to use for the current message.  You should make the
  66. 'get_sequence_number' routine as fast as possible so that other programs don't have to
  67. wait for you.  
  68.  
  69.  
  70. NOTE: Since the number is an integer, View can not handle very high numbers, therefore
  71. you may want to reset the number back down to 1 if it gets too high.  I usually reset it
  72. after 32,000 messages.
  73.  
  74.  
  75. Locking:  Now that we have our sequence number, we must lock it.  If we do not lock the
  76. number, Postman will try to process the files before we are done.  Locking is
  77. accomplished by creating ####.LCK.  For the rest of this document, I will use 1234 as
  78. our sequence number.  Once we have created 1234.LCK, our programs can as much time
  79. as required to build the rest of the files.  Postman will ignore all files associated with that
  80. number until the lockfile is erased.
  81.  
  82. TXT files:  The whole message is contained in 1234.TXT.  1234 is the sequence number
  83. obtained in the previous step.  Postman does not read the message file, instead it reads
  84. the .WRK file to determine the recipient.  Your program should generate a proper
  85. message including all header info.  
  86.  
  87. WRK files:  This is a very important file.  It tells the mailer who created the message,
  88. who should receive it, and where to send it next.   1234.WRK contains three lines.  An
  89. example follows:
  90.  
  91.  
  92. Example 1:
  93. uwovax.uwo.ca
  94. mark@novell.business.uwo.ca
  95. alvin@uwovax.uwo.ca
  96.  
  97.  
  98. Example 2:
  99. ria.uwo.ca
  100. mark@novell.business.uwo.ca
  101. alvin@uwovax.uwo.ca
  102.  
  103.  
  104. The 1st line contains the full hostname of where to send the message next.  It is possible
  105. that the final destination is not reachable from your location.  Therefore you may want
  106. the message to be 'punted' through a smart gateway(example 2).
  107.  
  108. The 2nd line is your full email address including the userid@hostname.
  109.  
  110. The 3rd line is the full email address for the recipient including the  userid, hostname plus
  111. any other routing info (uucp uses the form of site1!site2!site3@hostname)
  112.  
  113. Wrapping Up:  Now that we have created 1234.TXT and 1234.WRK, we can erase the
  114. 1234.LCK file.   We are finished with that peice of mail.  Postman will now try to deliver
  115. it to the recipient.
  116.  
  117.  
  118. Summary:  In conclusion, we have access the following files:  SEQUENCE.SEQ,
  119. SEQUENCE.LCK, 1234.LCK, 1234.WRK, 1234.TXT.   1234.TXT and 1234.WRK
  120. contains a fully ready to go mail message.